import {Component, ViewEncapsulation, HostListener, OnInit} from '@angular/core';
import { TipService, ModalTipService, ModalService ,HttpService} from 'itcloud-plugin';
import { GetPathService } from './get-path.service';

@Component({
  selector: 'app-root',
  moduleId: module.id,
  templateUrl: './app.component.html',
  styleUrls: [
    './app.component.css'
  ],
  encapsulation: ViewEncapsulation.None,
})
export class AppComponent {

  constructor(private http: HttpService,
              private GetPathService: GetPathService,) {
  }

  authority=true;
  ngOnInit() {
    console.log('ninini')
    document.cookie="userId="+'526';

    //通过门户获取人家的用户信息转给 后台 再获取我们自己的用户信息来用；
    this.http.getData({
      url: '/portal/home/getUserInfo',
      search: '',
    }).subscribe(res => {
      
    
      this.http.getData({
        url: this.GetPathService.AjaxPath.bulletinServer+'/login/checkUser',
        search: {syncId:''},
      }).subscribe(res => {
        document.cookie="userId="+res;

      this.authority=true;
        console.log(res);
      }, err => { });

      console.log(res);
    }, err => { });
  }
}

